/* 
 * File:   chemical_element.hpp
 * Author: jolo
 *
 * Created on 11. Oktober 2011, 08:17
 */

#ifndef MODEL_CHEMICAL_ELEMENT_HPP
#define	MODEL_CHEMICAL_ELEMENT_HPP

#include "standard_in_repository_entity.hpp"

namespace model
{

    class chemical_element : public standard_in_repository_entity
    {
    public:
        chemical_element(const string& symbol = "",
                         const string& name = "",
                         const string& description = "",
                         const string& group = "",
                         const string& period = "",
                         const double atomic_weight = 0.0,
                         const int number = 0,
                         repository* r = 0);

        virtual ~chemical_element();
        virtual const string to_string() const;
        
        virtual const string symbol() const {
            return symbol_;
        }
        
        virtual const string group() const {
            return group_;
        }
        
        virtual const string period() const {
            return period_;
        }
        
        virtual const double atomic_weight() const {
            return atomic_weight_;
        }
        
        virtual const int number() const {
            return number_;
        }
        
        virtual const string short_label() const;
        virtual const string object_name() const;
        virtual string_vector field_sequence() const;
        virtual string_map field_values() const;
        
    private:
        friend class boost::serialization::access;

        template<class Archive>
        void serialize(Archive & ar, const unsigned int version)
        {
            (void) version;
            ar & boost::serialization::base_object<standard_in_repository_entity > (*this);
            ar & symbol_;
            ar & group_;
            ar & period_;
            ar & atomic_weight_;
            ar & number_;
        }

        string symbol_;
        string group_;
        string period_;
        double atomic_weight_;
        int number_;
    };
    
    typedef shared_ptr<chemical_element> chemical_element_ptr;
    typedef vector<chemical_element_ptr> chemical_element_vector;
}

#endif	/* CHEMICAL_ELEMENT_HPP */

